<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Hrms</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="author" content="Yangliu449" />
    <!-- Icons -->
    <link href="assets/css/icons.css" rel="stylesheet" />
    <!-- Bootstrap stylesheets (included template modifications) -->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <script src="jquery-3_2_1.js" > </script>
    <!-- Main stylesheets (template main css file) -->
    <link href="assets/css/main.css" rel="stylesheet" />
    <meta name="msapplication-TileColor" content="#3399cc" />
</head>
<body>
<!-- Start #header -->
<div id="header">
    <div class="container-fluid">
        <div class="navbar">
            <div class="navbar-header">
                <a class="navbar-brand" href="index.html">
                    <i class="im-windows8 text-logo-element animated bounceIn"></i><span class="text-logo">hr</span><span class="text-slogan">ms</span>
                </a>
            </div>
            <nav class="top-nav" role="navigation">
                <ul class="nav navbar-nav pull-right">
                    <li class="dropdown">
                        <a href="#" id="username" >
                            <img class="user-avatar" src="assets/img/avatars/48.jpg" alt="SuggeElson">SuggeElson</a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
<!-- End #header -->
<!-- Start #sidebar -->
<div id="sidebar">
    <!-- Start .sidebar-inner -->
    <div class="sidebar-inner">
        <!-- Start #sideNav -->
        <ul id="sideNav" class="nav nav-pills nav-stacked">
            <li class="top-search">
                <form>
                    <input type="text" name="search" placeholder="Search ...">
                    <button type="submit"><i class="ec-search s20"></i>
                    </button>
                </form>
            </li>
            <li><a href="index.html" id="departmentManage">Department Manage <i class="im-screen"></i></a>
            </li>
            <li><a href="#" id="positionManage" >Position Manage<i class="st-chart"></i></a>
            </li>
            <li>
                <a href="data-tables.html">Employee Manage <i class="im-paragraph-justify"></i></a>
            </li>
            <li>
                <a href="data-tables.html" id="postManage" >Post Manage <i class="im-table2"></i></a>
            </li>
            <li>
                <a href="#" id="adminManage"><i class="st-files "></i>Admin Manage</a>
            </li>
            <li>
                <a href="#"><i class="en-upload "></i>Exit Hrms</a>
            </li>

        </ul>
    </div>
</div>

<!-- Start #content -->
<div id="content">
    <!-- Start .content-wrapper -->
    <div class="content-wrapper">
        <div class="row">
            <!-- Start .row -->
            <!-- Start .page-header -->
            <div class="col-lg-12 heading">
                <h1 class="page-header"><i class="im-screen"></i>欢迎使用HRMS</h1>
                <!-- Start .bredcrumb -->
                <ul id="crumb" class="breadcrumb">
                </ul>
                <!-- End .breadcrumb -->
                <!-- Start .option-buttons -->
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    <!--获取地址栏参数-->
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
    // 调用获取地址栏参数的方法
    var username =GetQueryString("username");
    if(username!=null && username.toString().length>1)
    {
        console.log(username);
    }


    var adminUrl = "/adminShow?username="+username;
    var postUrl = '/showPost?username='+username;
    var departmentUrl = '/departmentShow?username='+username;
    var positionUrl = '/positionShow?username='+username;
     $(document).ready(function(){
        $("#username").html("<img class=\"user-avatar\" src=\"assets/img/avatars/48.jpg\" alt=\"username\"></a>"+username);
        $("#adminManage").attr('href',adminUrl);
        $("#postManage").attr('href',postUrl);
        $("#departmentManage").attr('href',departmentUrl);
        $("#positionManage").attr('href',positionUrl);
     });
</script>

</body>
</html>